/*
 * Copyright (c) 2005 -2008 Reliable Source, Inc. and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Mozilla Public License v.1.1,
 * BSD, and Eclipse Public License v1.0 which accompanies this
 * distribution and is available at:
 *
 * 		http://www.eclipse.org/legal/epl-v10.html
 * 		http://www.opensource.org/licenses/bsd-license.php
 * 		http://www.mozilla.org/MPL/MPL-1.1.html
 *
 * Contributors:
 *     IBM Corporation	     -  http://ibm.com
 *     	- initial API and implementation
 *
 *     patientos.org         - http://patientos.org
 *     	- domain and database persistence layer
 *
 *     Reliable Source, Inc. - http://reliablesource.org
 *     	- Symbiosys Application Framework,
 *     	- Symbiosys Application, Symbiosys Product
 *
 */
package org.reliablesource.symbiosys.platform.views.properties.tabbed.patientrecord;

import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.TableItem;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.views.properties.tabbed.AbstractPropertySection;
import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;

/**
 * RecentResultsSection.java<br>
 * Created on: Jun 30, 2008<br>
 *
 * @author <a href="mailto:dennis.park@gmail.com">Dennis Park</a>
 *
 * @category
 * @since 1.0
 */
public class RecentResultsSection extends AbstractPropertySection {

    private Table table;
    public static final String [] COLUMNS = {"Date of Observation"} ;
    public static final String [] FIRST_ROW = {"Differential White Blood Cell Count", "Hematocrit",
	"Hemoglobin", "Mean Corpuscular Hemoglobin", "Mean Corpuscular Volume", "Mean Corpuscular Volume Concentration",
	"Mean Platelet Volume", "Platelet Count", "Red Blood Cell Count", "Red Blood Cell Indicies", "Stained Red Cell Examination", "White Blood Cell Count"} ;
    
    @Override
    public void createControls(Composite _parent,
	    TabbedPropertySheetPage _tabbedPropertySheetPage) {
	super.createControls(_parent, _tabbedPropertySheetPage);
//	
	Composite composite = getWidgetFactory()
		.createFlatFormComposite(_parent);
	FormData _data = new FormData();
	
        _data.left = new FormAttachment(0, 0);
        _data.right = new FormAttachment(100, 0);
        _data.top = new FormAttachment(0, 0);
	
	table = getWidgetFactory().createTable(composite, SWT.FULL_SELECTION);
	table.setLayoutData(_data);
	table.setLinesVisible(true);
	table.setHeaderVisible(true);
	
	for(int i = 0; i < COLUMNS.length; i++ ){
	    TableColumn _tblCol = new TableColumn(table, SWT.CENTER);
	    _tblCol.setText(COLUMNS[i]);
		_tblCol.pack();
	}
	for(int i = 0; i < FIRST_ROW.length; i++ ){
	    TableItem _tblItem = new TableItem(table, SWT.CENTER);
	    _tblItem.setText(FIRST_ROW[i]);
	}
	table.pack();
	
    }


    @Override
    public void setInput(IWorkbenchPart _part, ISelection _selection) {
	super.setInput(_part, _selection);
	
	//  We have IReliableElement.  Extract out the wrapped ISModel object.
	Object input = ((IStructuredSelection)_selection).getFirstElement();
    }
    
    

}
